home *** CD-ROM | disk | FTP | other *** search
- Path: s02.pavilion.co.uk!usenet
- From: AJRobb@pavilion.co.uk (Andy J Robb)
- Newsgroups: comp.lang.c
- Subject: Re: How to make this code portable?
- Date: Thu, 07 Mar 1996 05:12:23 GMT
- Organization: Pavilion Internet plc
- Message-ID: <4hlr68$4s@s02.pavilion.co.uk>
- References: <4h8k9j$78r@habs.ee.ubc.ca>
- NNTP-Posting-Host: poolc15.pavilion.co.uk
- X-Newsreader: Forte Free Agent 1.0.82
-
- ellenh@ee.ubc.ca (Ellen Ho) wrote:
-
- >I am writing a program that I want to compile and run on both a Sun
- >Sparcstation and a PC running OS/2 Warp. On the Sun, I compile the .c
- >files with gcc. On the PC, I am using Visual Age.
-
- >The program acceptes a list of filenames as command line
- >arguments and does some processing with the list of files.
- >On the Sun, I specify
-
- > program *.txt
-
- >and the shell will expand the wildcard into the names of all .txt
- >files in the current working directory. So with a for loop in
- >my C program I can go through each file and process the data.
-
- >However, on the PC, "*.txt" is passed into my program as
- >command line argument as is. This means that I may have to
- >put in extra operating system dependent logic to expand the wildcard
- >inside my program.
-
- >Are there other ways to handle this?
-
- -----BEGIN PGP SIGNED MESSAGE-----
-
- Borland compilers support wildcard expansion as an option.
-
- Alternatively, before you run the program on the Unix system, type:
-
- set noglob
-
- Then you will see "*.txt" under Unix too! ;)
-
- Regards,
- Andy Robb.
-
- -----BEGIN PGP SIGNATURE-----
- Version: 2.6.2i
-
- iQCVAwUBMT5wGpPl4P16x9sNAQEUoQP9EWk8zjG3GvjCVHYXwXbdLopG2vILumn3
- azd5hNyRuepcYM9OBXbfwJQp2baIdwhVIcuYmnAgsY7mkflpyWauNdAwj/kHne5J
- Ovth66UO0TabLwBfqWiX2vWn/f7vsqOadLCKE+ERhFFAIuBSED3fUNd5NYjR/daZ
- +pCDccoj1Rk=
- =VQ3w
- -----END PGP SIGNATURE-----
-
- -----BEGIN PGP PUBLIC KEY BLOCK-----
- Version: 2.6.2i
-
- mQCNAy/MpRwAAAEEAOt6uBYqT8yv9EmqNhK8m6v+bYi8QjnGW3Bo6iU1gsMj5pa6
- MHgq99c8deADbE3cbJ6uZS9v5pZE3WCf6HCQjlB5iULA5RZzMdAumd/WUzuL9UT3
- B44D9EqqFIL79FlYb56v4oKFqFp1/J2bIpYUwnUvabGzGjdLrpPl4P16x9sNAAUR
- tCNBbmR5IEogUm9iYiA8QUpSb2JiQHBhdmlsaW9uLmNvLnVrPrQhQW5keSBSb2Ji
- IDxBSlJvYmJAcGF2aWxpb24uY28udWs+
- =/wVD
- -----END PGP PUBLIC KEY BLOCK-----
-
-